package written_test;

import sun.security.util.Length;

import java.util.*;

/**
 * @author zhx
 * @since 2020-09-08
 */
public class Ctrip {

    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        String oldWord = in.nextLine();
        String sentence = in.nextLine();
        String newWord = in.nextLine();
        List<String> words = permutation(oldWord);
        for (String word : words) {
            sentence = sentence.replace(word,newWord);
        }
        System.out.println(sentence);
        in.close();
    }

    public static ArrayList<String> permutation(String str) {
        char[] data = str.toCharArray();
        ArrayList<String> result = new ArrayList<String>();
        permutation(data, 0, result);
        Set<String> set = new HashSet<>();
        set.addAll(result);
        result.clear();
        result.addAll(set);
        return result;
    }

    public static void permutation(char[] data, int beginIndex, ArrayList<String> result) {
        if (beginIndex == data.length - 1) {
            result.add(new String(data));
        } else {
            for (int i = beginIndex; i < data.length; i++) {
                if (i != beginIndex && data[i] == data[beginIndex]) {
                    continue;
                }
                char temp = data[beginIndex];
                data[beginIndex] = data[i];
                data[i] = temp;
                permutation(data, beginIndex + 1, result);

                temp = data[beginIndex];
                data[beginIndex] = data[i];
                data[i] = temp;
            }
        }
    }

    static List<String> res = new ArrayList<>();
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String flow = in.nextLine();
        String[] configs = flow.split(" ");

        int total = 1;
        for (int i = 0; i < configs.length; i++) {
                total = total * configs[i].length();
        }
        char[][] chars = new char[configs.length][total];
        for (int i = 0; i< configs.length;i++){
            for (int j = 0 ; j < configs[i].toCharArray().length;j++){

            }
        }
    }

    public static StringBuilder fun(String s,StringBuilder sb){
        for (int i = 0; i < s.toCharArray().length; i++) {
            sb.append(s.charAt(i));
        }
        return sb;
    }






}
